<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="/WEB-INF/template/template2013.xhtml">
	<ui:define name="pageTitle">Product List</ui:define>
	<ui:define name="content">

		<h:panelGroup id="productList">
			<h:dataTable value="#{pageController.productList}" var="p">
				<h:column>#{p.id}</h:column>
				<h:column>#{p.name}</h:column>
				<h:column>#{p.price}</h:column>
			</h:dataTable>
		</h:panelGroup>

		<h:form>
			<h:panelGrid columns="2">
			Id <h:inputText value="#{product.id}" />
			Name <h:inputText value="#{product.name}" />
			Price <h:inputText value="#{product.price}" />
			Description <h:inputText value="#{product.description}" />
				<h:commandButton value="Add" action="#{pageController.addProduct(product)}">
					<f:ajax execute="@form" render=":productList @form" />
				</h:commandButton>
			</h:panelGrid>
		</h:form>
	</ui:define>

</ui:composition>
</html>
